/* 全局样式 */
body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.navbar-brand {
    font-weight: bold;
}

/* 标签页切换 */
.tab-content {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 视频样式 */
video {
    max-width: 100%;
    height: auto;
    border: 2px solid #dee2e6;
    border-radius: 0.375rem;
}

/* 图片网格 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 5px;
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.image-item {
    position: relative;
    width: 80px;
    height: 80px;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    overflow: hidden;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-item .remove-btn:hover {
    background: rgba(220, 53, 69, 1);
}

/* 进度条样式 */
.progress {
    margin: 10px 0;
}

/* 预测结果样式 */
.prediction-item {
    margin-bottom: 15px;
}

.prediction-label {
    font-weight: bold;
    margin-bottom: 5px;
}

.prediction-value {
    font-size: 1.2em;
    color: #007bff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .image-item {
        width: 60px;
        height: 60px;
    }
}

/* 按钮间距 */
.btn {
    margin-right: 5px;
    margin-bottom: 5px;
}

/* 卡片样式 */
.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* 训练图表 */
#training-chart {
    max-width: 100%;
    height: auto;
    margin-top: 20px;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 状态指示器 */
.status-ready { color: #28a745; }
.status-training { color: #ffc107; }
.status-complete { color: #007bff; }
.status-error { color: #dc3545; }

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}
